]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Compare indicator and grid pages
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 25 May 2020 19:52:43 +0000 (16:52 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 18 Jun 2020 13:54:31 +0000 (10:54 -0300)
In the past, the icon grid would update the number of pages
during the call to adaptToSize(). However, after the new grid
layout landed, the number of pages is updated by the time an
item is added or removed.

Instead of comparing the old and new number of pages in the
icon grid, compare the pages shown by the indicator, and the
grid pages.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271

js/ui/appDisplay.js

index 2ada45406cb0c93eac1f68320e3294d0404f4084..ff813f3954783e4cdd24fb4d4c32e6625571bb13 100644 (file)
@@ -464,13 +464,12 @@ var BaseAppView = GObject.registerClass({
 
         const availWidth = box.get_width();
         const availHeight = box.get_height();
-        const oldNPages = this._grid.nPages;
 
         this._grid.adaptToSize(availWidth, availHeight);
 
         if (this._availWidth !== availWidth ||
             this._availHeight !== availHeight ||
-            oldNPages !== this._grid.nPages) {
+            this._pageIndicators.nPages !== this._grid.nPages) {
             Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
                 this._adjustment.value = 0;
                 this._grid.currentPage = 0;